home *** CD-ROM | disk | FTP | other *** search
/ Your Choice 3 / Your Choice Software Collection 3.iso / docs / alias / short.al < prev   
Text File  |  1994-09-08  |  12KB  |  336 lines

  1.      NOTE on this file
  2.  
  3.  
  4. The following is an ASCII file containing nothing but
  5. aliases as culled from the thread entitled "My favorite aliases"
  6. appearing in the PCVENB forum, section 10, in August 1994
  7.  
  8. Attributions appear before each section.  No one claims original 
  9. authorship, except as may be noted.
  10.  
  11. ----------------------
  12.      Sean Fosmire
  13. ----------------------
  14.  
  15. ca copy %1 %2 %3 %4 %5 %6 %7 %8 %9 a\
  16.    allows for entry of several filespecs for quick copy to A
  17. sc select /od copy (%2*.*) %1
  18.    organizes list of files then allows selection for copying
  19.    1st RP is the destination directory
  20. sca select /o-d copy (%1*.*) a\
  21.    combines the best of the two above
  22.    presents the current files, in reverse chronological order
  23.    to permit selection for copying to A
  24.    this way, the most recently added or changed files are on top
  25.    I also have "sm" and "sma" which do the same thing for the move command
  26. ix dir/djs > index
  27.   This produces an ASCII file listing all files in the current directory
  28.   and all subdirectories.  If run from C\, it will list all files in all
  29.   directories, with summary information.
  30. sl select list (%1*.*)
  31.   Allows selection of file for use of the 4DOS List command
  32.  
  33. -------------------------------------------------------------
  34.    NOTE on replaceable parameters in aliases
  35.    I frequently use the last RP in an alias as the first character
  36.     in a wildcard
  37.    see examples above and one below
  38.    this allows for quick narrowing by filename by entering one or more letters
  39.    e.g., with "d" below, enter "d ca" to list all files beginning with "ca"
  40. -------------------------------------------------------------
  41.  
  42. d dir/jp %1*.*
  43.    the "jp" is my preference -- separate extensions, stop display by page
  44.  
  45. fre free c d e f g j n > c\freedoc ^ type c\freedoc
  46.    uses the "free" command to display free space on all current drives
  47.  
  48. --------------------
  49.      Michael Geary
  50. --------------------
  51.  
  52.  Make it easier to type the ALIAS command
  53. al*ias  *alias
  54.  Edit Aliases
  55. ea      edit c\txt\alias.lst
  56.  Load Aliases
  57. la      ua * ^ alias /r c\txt\alias.lst && echo Aliases loaded
  58.  Clear Aliases
  59. ua      unalias
  60.  List the output of a command
  61. l*cmd   (%&) | list /s
  62.      This just runs any command and pipes its output to the LIST command.  Very
  63.      simple, but extremely useful.  L MEM /C is a typical use, or even L DIR.
  64.      Alternative, to pipe output to a file and then view it
  65. l*cmd   (%&) >C\TEMP\LCMD%_shell.LST ^ list C\TEMP\LCMD%_shell.LST
  66.      In case I run LCMD in more than one DOS session under Windows, the %_shell
  67.      gives a unique file name to each of the "pipe" files.  You could use %@unique
  68.      for this, but I wanted to be able to pick my own file name.
  69.  
  70.      With the LCMD alias, you could cut FRE down to
  71. fre     free c d e f g j n
  72.      and type L FRE at the C> prompt.  (Or, of course, include the L at the
  73.      beginning of the FRE alias itself if you always run it that way.)
  74.  Run a program in a specified directory IN <path> <program>
  75. in      pushd %1 ^ %2& ^ popd
  76.      This replaces all the batch files that wrap PUSHD and POPD around some
  77.      program that likes to be run from its own directory.
  78.  
  79.      My last one for now is a variation on this theme.  I normally run my DOS
  80.      sessions in 50 line mode.  A fair number of DOS programs have to run in 25
  81.      line mode.  Most of those are smart enough to at least switch to thame mode
  82.      first, but some are not.  They leave my screen in 50 line mode and run in the
  83.      top half of the screen, leaving the bottom half with whatever was on it.
  84.      Anyone who uses 50 line mode has run into this and may have batch files that
  85.      call MODE 80,25 before running such programs and MODE 80,50 after.  The easy
  86.      way is
  87. in25    mode 80,25 ^ %& ^ mode 80,50
  88.      IN25 and IN combine well.  To run V Communications' System Commander, I use
  89. scin    in25 in c\sc *scin
  90.  
  91. ----------------------
  92.      Howard Goldstein
  93. ----------------------
  94.  
  95.      This is an alias for the TIME command.  If entered with no operands, the date
  96.      and time are displayed as with the normal TIME command but the user is not
  97.      prompted for a new time.  If a parameter is given, the time is set.
  98.  
  99.      Note that this should all be entered on one line and that the caret (^) is
  100.      used as the command separator
  101.  
  102. time iff %#==0 then^keystack enter^*time|echo %@line[con,0]^else^*time %&^endiff
  103.  
  104. :----------------------
  105.      Variation on above
  106.      suggested by Mike Bessy
  107.      with Howard's addition
  108. :----------------------
  109.  
  110.      May I suggest a variation that doe _not_ require that KSTACK be loaded and can
  111.      also be used under OS/2 or NT (with suitable ParameterChar and CommandSep, of
  112.      course)
  113.  
  114. time=iff "%&"=="" then^echo The time is %_time^else^time%&^endiff
  115.  
  116. :----------------------
  117.      Don E. Groves, Jr.
  118. :----------------------
  119.  
  120. DATER=(dater_date %+ ECHO  %_time)
  121.  
  122. DATER12=(dater_date %+ dater_time ^echo.)
  123.  
  124. DATER_DATE=
  125.   ECHOS %_Dow %@substr[JanFebMarAprMayJunJulAugSepOctNovDec,
  126.         %@eval[(%@substr[%_date,0,2]-1)*3],3] %@eval[%@substr[%_date,3,2]],
  127.         19%@substr[%_date,6,2]
  128.  
  129. DATER_TIME=
  130.    ECHOS  %@substr[12 1 2 3 4 5 6 7 8 91011,
  131.           %@eval[%@substr[%_time,0,2] %% 12*2],2]
  132.           %@substr[%_time,2,6]
  133.           %@substr[AP,%@int[%@eval[%@time[%_time]/3600/12]],1]M
  134.  
  135. :    Notes
  136.  
  137.      (note DATER_DATE and DATER_TIME each go on one long line a piece. -)
  138.  
  139.      They produce the output in the format of
  140.        DATER
  141.        Tue Aug 23, 1994 002316
  142.  
  143.      and
  144.        DATER12
  145.        Tue Aug 23, 1994 122403 AM
  146.  
  147.      And yes they are all pipeable to a file or whereever.
  148.  
  149.  
  150. :----------------------
  151.      Charlie Weesner
  152. :----------------------
  153.  
  154.      My "favorite" three aliases require using NCD (Norton's Change Directory) or
  155.      LCD (LED's Change Directory).  These programs provide direct navigation from
  156.      any level of the directory tree to any other level (including completion of
  157.      partial directory names or mis-spellings).
  158.  
  159. cd=lcd
  160. md=lcd md
  161. rd=lcd rd
  162.  
  163.      If you want to use the original command, rather than the alias, you either
  164.      "chdir" or "*cd" where the "*" disables any alias replacement of the
  165.      command.
  166.  
  167.  
  168. :----------------------
  169.      Niels Schaumann 
  170. :----------------------
  171.  
  172.      walks back up the directory tree from current location, # levels = # dots
  173. .*........  pushd%0
  174.  
  175.      nothing fancy, just what it says
  176.  
  177. popd
  178.  
  179.      I've gotten used to these, been using them for a couple of years.  I don't
  180.      remember who came up with them .... I do remember someone pointing out that
  181.      the "multiple dots" weren't supposed to work, but hey ..... they sure do!
  182.  
  183. :----------------------
  184.      Gary M. Berg 
  185. :----------------------
  186.  
  187.  ;    Clear the screen
  188.  clear           cls white on blue
  189.  
  190.  ;    Run a command and pipe stdout into LIST
  191.  so              %& | list/s
  192.  
  193.  ;    Use a "string" utility to get likely "text" in a file, send it to
  194.  ;    stdout and view it with LIST
  195.  inside          so string %&
  196.  
  197.  ;    Reload standard aliases
  198.  new_4d*os       unalias * ^ alias /r c\cmd\4dos.ali
  199.  
  200.  ;    Control/T runs MAPMEM
  201.  @@ctrl-T        mapmem
  202.  
  203.  ;    Alt-F4 types EXIT - similar to closing a winapp
  204.  @@Alt-F4        exit
  205.  
  206.  ;
  207.  ;    Directory management utilities.  Allow changing to a subdir to run
  208.  ;    a program and then return - will not have changed current directory
  209.  ;    on any drives.
  210.  popdir_2
  211.  popdir_3
  212.  push_xd         pushd d ^ pushd
  213.  push_xdf        pushd d ^ pushd e ^ pushd
  214.  push_xe         pushd e ^ pushd
  215.  ;   Example of using push and pop routines
  216.  alpha*4         push_xde^cd \alpha4^*a4 %&^popdir_3
  217.  
  218.  ;
  219.  ;   ACD is a utility a bit like NCD; use it so an invalid command tries
  220.  ;   to change to the command line as a sub-directory.
  221.  UNKNOWN_CMD     acd %1
  222.  
  223.  
  224. :----------------------
  225.      Eric Veldhuyzen 
  226. :----------------------
  227.  
  228.      You want some nice aliases? How about my dir alias under 4OS2
  229.  
  230. DIR=iff "%1" eq "" then
  231.    ^set pad=.
  232.    ^else set pad=%1
  233.    ^endiff
  234.    ^iff exist %pad\descript.ion then
  235.    ^*dir /A/Z/P/OgE/J %&
  236.    ^unset pad
  237.    ^quit
  238.    ^else
  239.    ^*dir /T/A/P/OgE/J %&
  240.    ^unset pad
  241.    ^quit
  242.    ^endiff
  243.  
  244.      This of course all on one line, but I cut it for readability.
  245.  
  246. :----------------------
  247.      Anthony Williams 
  248. :----------------------
  249.  
  250.  4ED*DIT=select %1 describe (*.*)
  251.  @@Shift-F1=so *alias
  252.  ADDR*ESS=ks "f%&" 13 %+ list e\mydoc\addr.bk
  253.  ALLF*REE=free c %+ free d %+ free e %+ free f %+ free g
  254.  ALUP*DATE=pushd c\4dos50 %+ COPY ALIAS.LST ALIAS.%@SUBSTR[%_TIME,4,1
  255.       ]%@SUBSTR[%_TIME,6,2] /Q %+ alias > alias.lst %+ echo  !ALIAS
  256.       LIST UPDATED! %+ renew %+ popd %+ beep
  257.  DIRARC=dir *.zip;*.arj;*.lzh
  258.  DIRBAT=dir *.btm;*.bat
  259.  DIRCMD=dir /k *.exe;*.com;*.btm;*.bat
  260.  DIREX=dir *.com;*.exe
  261.  MEMF=free %+ memory
  262.  NOW=echo It is now %_time on %_dow %_date
  263.  RENEW=unalias * %+ alias /r c\4dos50\alias.lst %+ echo ALIAS LIST REREAD!
  264.  RESETN=unset * %+ set /r c\4dos50\var.lst %+ echo ENVIRONMENTAL VARIABLES
  265.       RESET!
  266.  SOT*se=%& > %tmp%!tsetmp!.!!! %+ e %tmp%!tsetmp!.!!! %+ del %tmp%!tsetmp!.!!!
  267.  TOCP=prompt $p$g %+ set comspec=c\dos\command.com %+ c\dos\command/e2048
  268.       %+ c\4dos50\4start %+ set comspec=c\4dos50\4dos.com
  269.  
  270. Explanation
  271.  
  272.  4ED -- select files for writing Descriptions
  273.  ADDR -- calls up my address book in Buerg's LIST and finds the name I have
  274.          requested, e.g. "ADDR Smith"
  275.  ALUP -- updates my master alias list, but only after making a backup
  276.  DIRARC, DIRBAT, DIRCMD, DIREX -- various selective Dir commands
  277.  SOT -- puts standard output into my editor via a temp file
  278.  TOCP -- when I want to see how hard a time the other 99% of PC users have
  279.          it!
  280.  
  281. :----------------------
  282.      Allen Cobb 
  283. :----------------------
  284.  
  285.  ; Make a directory and move files with same first name into it.
  286.  MDF=md %1^move %1.* %1^cd %1
  287.  
  288.  ; Remove file from B and copy new version to B.
  289.  BDELCOPY=del b%1^copy %1 b
  290.  
  291.  ; Quick access to doc, bat, & btm files.
  292.  DOC=c\util\list.com c\doc\%1.doc
  293.  BAT=c\util\q.exe c\bat\%1.bat
  294.  BTM=c\util\q.exe c\bat\%1.btm
  295.  
  296.  ; Quick setup for 4DOS aliases, etc.  (This may be my favorite.)
  297.  S4=c\util\q.exe c\bat\set4dos.bat c\4dos\4dos.ini^c\bat\set4dos.bat
  298.  
  299.  ; Directory shortcuts.
  300.  CD=*pushd
  301.  PD=pushd
  302.  BD=popd
  303.  H=cd \^cdd c\^cls
  304.  
  305.  ; Safety enhancements.
  306.  MOVE=*move /r
  307.  COPY=*copy /r
  308.  DELDIR=echo CAUTION! Removing %1 and all subdirs!^pause^del %1 /sxqy
  309.  
  310.  ; Standard calculator alias from docs.
  311.  CALC=*set x=%@eval[%&]^echo %x
  312.  
  313.  ; PKZIP shorthand.
  314.  UZP=select c\util\pkunzip (*.*) d\ %1
  315.  LZP=select c\util\pkunzip (*.zip) -vn  list /s
  316.  AZP=select c\util\pkzip %1 -a %2& [*.*]
  317.  
  318.  ; 50,000,000 directory commands.
  319.  D=*dir /kmpaou            primary DIR command
  320.  DB=*dir b /kpaou         show drive B
  321.  DA=*dir /4kmpvou /aa      show everything
  322.  D2=*dir /p2ou /v          two columns
  323.  DD=*dir /4kmpv            wide, with sizes
  324.  DW=*dir /pouwkmv          very wide
  325.  DF=*dir /pkmt/a-d/ou     just a file list
  326.  DC=*dir /kmpaou *.c       c source files
  327.  DR=*dir /adwkm            just directories, very wide
  328.  DZ=*dir /su               just space info
  329.  DZIP=*dir /kmpaou *.zip   just zips
  330.  DX=except (%%&) *dir /oufp
  331.  DDIR=*dir /ad             just dirs, listed
  332.  DRI=dir                   yes, I do this too
  333.  DIR=*dir /ou              default dir
  334.  DH=echo D DA DB DD DW DF DC DZ DX DR DDIR DRI DIR
  335.  
  336.